export interface SearchInfo {
	userId?: number;
	referrerId?: number;
	amount?: number;
	status?: number;
	nickname?: string;
	refererNickname?: string;
	refererCode?: string;
	code?: string;
}

export interface pageInfo {
	current?: number;
	pageSize?: number;
	total?: number;
	showTotal: Function;
	showSizeChanger: boolean;
	pageSizeOptions: string[];
	showSizeChange: Function;
	size: string;
	showQuickJumper: boolean;
	defaultPageSize: number;
}

export let pagination = ref<any>({
	// 数据总数
	total: 0,
	// 当前页数
	current: 1,
	// 每页条数
	pageSize: 10,
	// 展示总数
	showTotal: (total: number) => `共 ${total} 条`,
	// 是否可以改变pageSize
	showSizeChanger: true,
	// 设置每页可以展示多少条的选项
	pageSizeOptions: ['10', '20', '50', '100'],
	// 改变pageSize后触发
	showSizeChange: (current: number, pageSize: any) => (
		(pagination.value.current = current),
		(pagination.value.pageSize = pageSize)
	),
	// 小尺寸分页
	size: 'small',
	// 是否可以快速跳转至某页
	showQuickJumper: true,
	//默认条数
	defaultPageSize: 10,
});

export const columns = ref<any>([
	{ title: '用户编码', dataIndex: 'code', key: 'code', width: '120px' },
	{ title: '昵称', dataIndex: 'nickname', key: 'nickname', width: '140px' },
	{
		title: '推荐人编码',
		dataIndex: 'refererCode',
		key: 'refererCode',
		width: '140px',
	},
	{
		title: '推荐人昵称',
		dataIndex: 'refererNickname',
		key: 'refererNickname',
		width: '140px',
	},
	{
		title: '订单总金额',
		dataIndex: 'totalAmount',
		key: 'totalAmount',
		width: '140px',
	},
	{ title: '佣金金额', dataIndex: 'amount', key: 'amount', width: '140px' },
]);
